package com.newbee.sustainability.userbusiness.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description：用户信息
 * Date：2018/12/28
 * Time：14:34
 *
 * @author Likailun
 */
@RestController
@RequestMapping("/user")
public class UserInfoController {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserInfoController.class);

    @Value("${server.port}")
    private Integer port;

    @GetMapping()
    public String info() {
        LOGGER.info("response client from server port:{}", port);
        return "user-business：user info！";
    }

    @GetMapping("/getUser/{id}")
    public String getUser(@PathVariable String id) {
        LOGGER.info("response client from server port:{}", port);
        return "getUser id = " + id;
    }
}
